<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>034-淡入-淡出-切换.html</title>
	<style>
		div{
			width: 200px;
			height: 200px;
			background-color: red;
			display: none;
		}
	</style>
</head>
<body>
	<button>淡出</button>
	<button>淡入</button>
	<button>切换</button>
	<button>淡入到</button>
	<div></div>
</body>
	<script src="js/jquery-1.12.4.js"></script>
	<script>
		$(function(){
			$('button').eq(0).on('click',function(){
				$('div').fadeIn(1000,function(){
					alert('fadeIn done');
				});
			});
			$('button').eq(1).on('click',function(){
				$('div').fadeOut(1000,function(){
					alert('fadeOut done');
				});
			});
			$('button').eq(2).on('click',function(){
				$('div').fadeToggle(1000,function(){
					alert('fadeToggle done');
				});
			});
			$('button').eq(3).on('click',function(){
				$('div').fadeTo(1000,0.5,function(){
					alert('fadeTo done');
				});
			});
		})
	</script>
</html>